import processing.core.PApplet;
public class MenuBox {
	float menuX,menuY,menuWidth,menuHeight;
	PApplet parent = null;
	float cornerRadius;
	int scaleFactor;
	float itemWidth,itemHeight;
	TouchRadioButtonGroup myMaleButton;
	TouchRadioButtonGroup myFemaleButton;
	TouchRadioButtonGroup mySpeedingButton;
	TouchRadioButtonGroup myNotSpeedingButton;
	TouchRadioButtonGroup myDarkButton;
	TouchRadioButtonGroup myDawnButton;
	TouchRadioButtonGroup myDaylightButton;
	TouchRadioButtonGroup myDuskButton;
    TouchRadioButtonGroup myMidnight;
    TouchRadioButtonGroup myMorning;
    TouchRadioButtonGroup myAfternoon;
    TouchRadioButtonGroup myEvening;
    TouchRadioButtonGroup myClearButton;
    TouchRadioButtonGroup myObscureButton;
    TouchRadioButtonGroup myRainButton;
    TouchRadioButtonGroup myWindbutton;
    TouchRadioButtonGroup mySleetButton;
    TouchRadioButtonGroup mySnowButton;
    TouchRadioButtonGroup myWeatherOther;
    TouchRadioButtonGroup myHatchback;
    TouchRadioButtonGroup mySedan;
    TouchRadioButtonGroup mySUV;
    TouchRadioButtonGroup myVan;
    TouchRadioButtonGroup myWagon;
    //TouchRadioButtonGroup myTruck;
    //TouchRadioButtonGroup myBus;
    TouchRadioButtonGroup myOtherVehicle;
    TouchRadioButtonGroup myDrunk;
    TouchRadioButtonGroup myNonAlcohol;
    TouchRadioButtonGroup myDrug;
    TouchRadioButtonGroup myNotDrug;
    TouchRadioButtonGroup myLess20;
    TouchRadioButtonGroup my20to40;
    TouchRadioButtonGroup my40to60;
    TouchRadioButtonGroup my60to80;
    TouchRadioButtonGroup myMore80;
    TouchRadioButtonGroup myWeekday;
    TouchRadioButtonGroup myWeekend;
    
public MenuBox(PApplet parent,float x,float y,float width,float height,int scaleFacor){
	this.parent = parent;
	this.menuX = x;
	this.menuY = y;
	this.menuWidth = width;
	this.menuHeight =height;
	this.scaleFactor=scaleFacor;
	itemHeight = 15*scaleFactor;
	itemWidth = 25*scaleFactor;
//	parent.loadFont("LetterGothicStd-32.vlw");
//	parent.setFont(parent.getFont());
	myMaleButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*0.60), false);
	myMaleButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,5,5));
	myMaleButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,5,5));
	myFemaleButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*0.90), false);
	myFemaleButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myFemaleButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	mySpeedingButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*1.55), false);
	mySpeedingButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	mySpeedingButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myNotSpeedingButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*1.85), false);
	myNotSpeedingButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myNotSpeedingButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myDarkButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*2.50), false);
	myDarkButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myDarkButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myDawnButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*2.80), false);
	myDawnButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myDawnButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myDaylightButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*3.10), false);
	myDaylightButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myDaylightButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myDuskButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*3.40), false);
	myDuskButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myDuskButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myMidnight = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*4.05), false);
	myMidnight.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myMidnight.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myMorning = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*4.35), false);
	myMorning.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myMorning.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myAfternoon = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*4.65), false);
	myAfternoon.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myAfternoon.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myEvening = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth/7 - 50*scaleFacor), (float)(menuY+menuY*4.95), false);
	myEvening.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myEvening.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myClearButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*0.60), false);
	myClearButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myClearButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myObscureButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*0.90), false);
	myObscureButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myObscureButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myRainButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*1.20), false);
	myRainButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myRainButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myWindbutton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*1.50), false);
	myWindbutton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myWindbutton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	mySleetButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*1.80), false);
	mySleetButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	mySleetButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	mySnowButton = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*2.10), false);
	mySnowButton.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	mySnowButton.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myWeatherOther = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*2.40), false);
	myWeatherOther.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myWeatherOther.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myHatchback = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*3.05), false);
	myHatchback.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myHatchback.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	mySedan = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*3.35), false);
	mySedan.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	mySedan.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	mySUV = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*3.65), false);
	mySUV.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	mySUV.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myVan = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*3.95), false);
	myVan.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myVan.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myWagon = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*4.25), false);
	myWagon.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myWagon.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	//myTruck = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*4.55), false);
	//myTruck.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	//myTruck.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	//myBus = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*4.85), false);
	//myBus.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	//myBus.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myOtherVehicle = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*2/7 - 65*scaleFacor), (float)(menuY+menuY*4.55), false);
	myOtherVehicle.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myOtherVehicle.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myDrunk = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*3/7 - 60*scaleFacor), (float)(menuY+menuY*0.60), false);
	myDrunk.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myDrunk.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myNonAlcohol = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*3/7 - 60*scaleFacor), (float)(menuY+menuY*0.90), false);
	myNonAlcohol.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myNonAlcohol.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myDrug = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*3/7 - 60*scaleFacor), (float)(menuY+menuY*1.55), false);
	myDrug.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myDrug.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myNotDrug = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*3/7 - 60*scaleFacor), (float)(menuY+menuY*1.85), false);
	myNotDrug.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myNotDrug.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myLess20 = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*3/7 - 60*scaleFacor), (float)(menuY+menuY*2.40), false);
	myLess20.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myLess20.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	my20to40 = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*3/7 - 60*scaleFacor), (float)(menuY+menuY*2.70), false);
	my20to40.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	my20to40.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	my40to60 = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*3/7 - 60*scaleFacor), (float)(menuY+menuY*3.00), false);
	my40to60.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	my40to60.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	my60to80 = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*3/7 - 60*scaleFacor), (float)(menuY+menuY*3.30), false);
	my60to80.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	my60to80.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myMore80 = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*3/7 - 60*scaleFacor), (float)(menuY+menuY*3.60), false);
	myMore80.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myMore80.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myWeekday = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*3/7 - 60*scaleFacor), (float)(menuY+menuY*4.25), false);
	myWeekday.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myWeekday.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
	myWeekend = new TouchRadioButtonGroup(parent, (menuWidth/2 + menuWidth*3/7 - 60*scaleFacor), (float)(menuY+menuY*4.55), false);
	myWeekend.AddItem(new TouchRadioButton(parent,"Yes",itemWidth,itemHeight,25,25));
	myWeekend.AddItem(new TouchRadioButton(parent,"No",itemWidth,itemHeight,25,25));
}
public void drawbox(boolean drawState,int scaleFactor){
	if(drawState){
		float xPosCol1 = myMaleButton.getXPos()-5;
		float xPosCol2 = myWeatherOther.getXPos()-5;
		float xPosCol3 = myDrunk.getXPos() - 5;
		parent.rectMode(parent.CORNERS);
		parent.noStroke();
		parent.fill(150);
		parent.rect(menuX, menuY, menuWidth, menuHeight);
		parent.fill(255);
		parent.textSize(12*scaleFactor);
		parent.text("Menu",menuWidth/2,(float)(menuY+menuY*0.25));
		
		
		
		parent.textAlign(parent.RIGHT);
		parent.fill(0);
		parent.textSize(10*scaleFactor);
		parent.text("Sex",xPosCol1 , (float)(menuY+menuY*0.60));			
		parent.textSize(10*scaleFactor);
		parent.fill(255);
		parent.text("Male",xPosCol1,(float)(menuY+menuY*0.90));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myMaleButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);		
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Female",xPosCol1,(float)(menuY+menuY*1.2));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myFemaleButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(0);
		parent.textSize(12*scaleFactor);
		parent.text("Speed Related",xPosCol1,(float)(menuY+menuY*1.55));
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Speeding",xPosCol1,(float)(menuY+menuY*1.85));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		mySpeedingButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Not Speeding",xPosCol1,(float)(menuY+menuY*2.15));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myNotSpeedingButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(0);
		parent.textSize(12*scaleFactor);
		parent.text("Light Condition",xPosCol1,(float)(menuY+menuY*2.50));
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Dark",xPosCol1,(float)(menuY+menuY*2.80));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myDarkButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Dawn",xPosCol1,(float)(menuY+menuY*3.10));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myDawnButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Daylight",xPosCol1,(float)(menuY+menuY*3.40));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myDaylightButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Dusk",xPosCol1,(float)(menuY+menuY*3.70));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myDuskButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(0);
		parent.textSize(12*scaleFactor);
		parent.text("Time of Crash",xPosCol1,(float)(menuY+menuY*4.05));
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("12:00 AM - 6:00 AM",xPosCol1,(float)(menuY+menuY*4.35));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myMidnight.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("6:00 AM - 12:00 PM",xPosCol1,(float)(menuY+menuY*4.65));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myMorning.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("12:00 PM - 6:00 PM",xPosCol1,(float)(menuY+menuY*4.95));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myAfternoon.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("6:00 PM - 12:00 AM",xPosCol1,(float)(menuY+menuY*5.25));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myEvening.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(0);
		parent.textSize(12*scaleFactor);
		parent.text("Weather",xPosCol2,(float)(menuY+menuY*0.60));
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Clear",xPosCol2,(float)(menuY+menuY*0.90));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myClearButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Obscure Visibility",xPosCol2,(float)(menuY+menuY*1.20));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myObscureButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Rain",xPosCol2,(float)(menuY+menuY*1.50));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myRainButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Crosswinds",xPosCol2,(float)(menuY+menuY*1.80));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myWindbutton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Sleet/Hail",xPosCol2,(float)(menuY+menuY*2.10));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		mySleetButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Snow",xPosCol2,(float)(menuY+menuY*2.40));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		mySnowButton.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Other",xPosCol2,(float)(menuY+menuY*2.70));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myWeatherOther.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(0);
		parent.textSize(12*scaleFactor);
		parent.text("Vehicle",xPosCol2,(float)(menuY+menuY*3.05));
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Hatchback",xPosCol2,(float)(menuY+menuY*3.35));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myHatchback.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Sedan",xPosCol2,(float)(menuY+menuY*3.65));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		mySedan.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("SUV",xPosCol2,(float)(menuY+menuY*3.95));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		mySUV.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Van",xPosCol2,(float)(menuY+menuY*4.25));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myVan.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Wagon",xPosCol2,(float)(menuY+menuY*4.55));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myWagon.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		//parent.text("Trucks",xPosCol2,(float)(menuY+menuY*4.85));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		//myTruck.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		//parent.text("Bus",xPosCol2,(float)(menuY+menuY*5.10));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		//myBus.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Other",xPosCol2,(float)(menuY+menuY*4.85));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myOtherVehicle.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(0);
		parent.textSize(12*scaleFactor);
		parent.text("Alcohol",xPosCol3,(float)(menuY+menuY*0.60));
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Drunk Driving",xPosCol3,(float)(menuY+menuY*0.90));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myDrunk.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Alcohol Not Involved",xPosCol3,(float)(menuY+menuY*1.20));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myNonAlcohol.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(0);
		parent.textSize(12*scaleFactor);
		parent.text("Drugs",xPosCol3,(float)(menuY+menuY*1.55));
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Drugs Involved",xPosCol3,(float)(menuY+menuY*1.85));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myDrug.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Drugs Not Involved",xPosCol3,(float)(menuY+menuY*2.15));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myNotDrug.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(0);
		parent.textSize(12*scaleFactor);
		parent.text("Age",xPosCol3,(float)(menuY+menuY*2.40));
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Less than 20yr",xPosCol3,(float)(menuY+menuY*2.70));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myLess20.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("20 to 40yr",xPosCol3,(float)(menuY+menuY*3.00));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		my20to40.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("40 to 60yr",xPosCol3,(float)(menuY+menuY*3.30));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		my40to60.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("60 to 80yr",xPosCol3,(float)(menuY+menuY*3.60));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		my60to80.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("More than 80yr",xPosCol3,(float)(menuY+menuY*3.90));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myMore80.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(0);
		parent.textSize(12*scaleFactor);
		parent.text("Weekend/Weekday",xPosCol3,(float)(menuY+menuY*4.25));
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Weekday",xPosCol3,(float)(menuY+menuY*4.55));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myWeekday.draw();
		parent.noStroke();
		
		parent.textAlign(parent.RIGHT);
		parent.fill(255);
		parent.textSize(10*scaleFactor);
		parent.text("Weekend",xPosCol3,(float)(menuY+menuY*4.85));
		
		parent.stroke(254);
		parent.strokeWeight(1*scaleFactor);
		myWeekend.draw();
		
		parent.fill(130);
		parent.stroke(0);
	}
}
public MenuResult touchHandler(float xPos, float yPos){
	int selectedIndex = -1; // -1 not selected 0-add it 1-remove it

	selectedIndex = myWeekend.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Weekend,selectedIndex);
	}
	
	selectedIndex = myWeekday.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Weekday,selectedIndex);
	}
	
	selectedIndex = myMore80.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.EightyTo100Age,selectedIndex);
	}
	
	selectedIndex = my60to80.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.SixtyTo80Age,selectedIndex);
	}
	
	
	selectedIndex = my40to60.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.FortyTo60Age,selectedIndex);
	}
	
	selectedIndex = my20to40.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.TwentyTo40Age,selectedIndex);
	}
	
	selectedIndex = myLess20.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.ZeroTo20Age,selectedIndex);
	}
	
	selectedIndex = myNotDrug.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.NotDrugs,selectedIndex);
	}
	
	selectedIndex = myDrug.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Drugs,selectedIndex);
	}
	
	selectedIndex = myNonAlcohol.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.NonAlcohol,selectedIndex);
	}
	
	selectedIndex = myDrunk.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Alcohol,selectedIndex);
	}
	
	selectedIndex = myOtherVehicle.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.OtherVehicle,selectedIndex);
	}
	
	//selectedIndex = myBus.TouchHandler(xPos, yPos);
	//if(selectedIndex > -1){
	//	return new MenuResult(GraphSubgroup.OtherVehicle,selectedIndex);
	//}
	
	//selectedIndex = myTruck.TouchHandler(xPos, yPos);
	//if(selectedIndex > -1){
	//	return new MenuResult(GraphSubgroup.WagonVehicle,selectedIndex);
	//}
	
	selectedIndex = myVan.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.VanVehicle,selectedIndex);
	}
	
	selectedIndex = mySUV.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.SUVVehicle,selectedIndex);
	}
	
	selectedIndex = mySedan.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.SedanVehicle,selectedIndex);
	}
	
	selectedIndex = myHatchback.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.HatchbackVehicle,selectedIndex);
	}
	
	
	
	selectedIndex = myWeatherOther.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.OtherVis,selectedIndex);
	}
	
	selectedIndex = mySnowButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.SnowVis,selectedIndex);
	}
	
	selectedIndex = mySleetButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.SleetHailVis,selectedIndex);
	}
	
	selectedIndex = myWindbutton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.SevereCrosswindsVis,selectedIndex);
	}
	
	selectedIndex = myRainButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.RainVis,selectedIndex);
	}
	
	selectedIndex = myObscureButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.ObscureVis,selectedIndex);
	}
	
	
	selectedIndex = myClearButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.ClearVis,selectedIndex);
	}
		
	selectedIndex = myEvening.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.SixtoMidnight,selectedIndex);
	}
	
	selectedIndex = myAfternoon.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Twelveto6,selectedIndex);
	}
	
	selectedIndex = myMorning.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Sixto12,selectedIndex);
	}
		
	selectedIndex = myMidnight.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Zeroto6,selectedIndex);
	}
	
	selectedIndex = myDuskButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Dusk,selectedIndex);
	}
	
	selectedIndex = myDaylightButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Daylight,selectedIndex);
	}
	
	selectedIndex = myDawnButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Dawn,selectedIndex);
	}
	
	selectedIndex = myDarkButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Dark,selectedIndex);
	}
	
	selectedIndex = myNotSpeedingButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.NotSpeeding,selectedIndex);
	}
	
	selectedIndex = mySpeedingButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Speeding,selectedIndex);
	}
	
	selectedIndex = myFemaleButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Female,selectedIndex);
	}
	
	selectedIndex = myMaleButton.TouchHandler(xPos, yPos);
	if(selectedIndex > -1){
		return new MenuResult(GraphSubgroup.Male,selectedIndex);
	}
	
	
	return new MenuResult(null,-1);
}


}
